package com.example.demo_dongruanD.service.impl;


import com.example.demo_dongruanD.pojo.Users;
import com.example.demo_dongruanD.repository.UsersRepository;
import com.example.demo_dongruanD.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    private final UsersRepository userRepository;

    @Autowired
    public UserServiceImpl(UsersRepository userRepository) {
        this.userRepository = userRepository;
    }

    @Override
    public Users findByUserId(String userId) {
        return userRepository.findByUserId(userId).orElse(null);
    }
}
